All right, one more thing for our Kills Death leaderboard.
Let's give points for a zombie kill or for any monster kill.
And I'll also show you where you can add code if you want to actually grant the player kills for non
playing characters.
Let's go to a zombie first.
We have these two floating around here in the world and I'm going to.
Check this out.
This is a roadblocks product, too.
And they just name this script.
So just just be aware of that because I'm going to add a script.
And then I'm going to get confused of which one it is.
So the one I just added is, of course, the one I want to add code to, not that other one that's already
full of stuff.
I'm going to do a variable char for the character, for the zombie character.
So script parent and then I'm going to do a variable for the humanoid we get from the char and we'll
do way for child.
You don't really need it here because it is on the server.
You can just do char dot humanoid.
It would work fine, but I'm just being careful and then we're going to get the humanoid died event
of the zombie.
We're going to connect that and then we're going to get a tag to see if there is a tag on the humanoids
or do a fine first child.
And I'm going to look for the tag called Creator will say If tag and tag value, then we will get the
enemy player of the zombie e player tag dot value and.
If you want to do kills, you could do the kills here.
I'm just going to do the points right now.
So I'll say e player dot leader stats.
That's that's you.
If you kill the zombie, you're its enemy.
I'll do points dot value plus equals what you give them 20 points.
20 points for kill.
There we go.
So if you want kills, I'm not going to add this to the game, but I'll just show you real quick if
you want kills.
Just change this to kills and then you'll do the plus equals one.
And let me comment that out because I don't want that in my game.
But you might.
And I just wanted to make sure that you knew how to do that.
That's pretty cool.
Now I'm going to get that script.
I'm going to rename it because.
That's the other one.
That's the one I just did.
Let's rename that to give points.
Give points?
I'm going to copy it.
I'll put it in my other zombie.
These two loose zombies floating around paste into.
But we're not going to use the collection service or the tagging for this because almost everything
is spawned.
Right?
So I'll just go down to server storage and then I'll paste into.
We'll give that give points.
And then I think we had zombies in our simple zombie spotter.
Let's go ahead and select all of these right click paste into selected and we should have our give points
on all of those.
All right.
Let's try it out.
Let's see if we get some points for some zombie kills.
Oh, man.
I should have done a play from here.
That's all right.
Let's try out our.
We haven't done anything with this in a while, and then we'll get our our coins, and we'll be able
to run real fast.
Cool.
Turn to release Valve.
Ah, yeah.
Here they come.
30 points.
That's right.
Because I got the coin and then as I.
Yeah.
Looking good.
We're getting some kills.
Let's run over here.
Make sure that other one.
Oh, we killed those zombies with.
With the.
With the eruption.
Here we go.
We got some spawned ones over here.
Yep.
90.
Looking good.
So we're getting some points for our kills.